package com.augurit.gzcgwsp.rqqyjyxk.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.augurit.common.base.dao.BaseDao;
import com.augurit.gzcgwsp.rqqyjyxk.entity.YwRqQyjyxkFinalRqjszdjb;

/**
 * <P>title:最终数据广州市燃气经营许可证许可审批----燃气接收站、储配站、汽车加气站登记表Dao</p>																								
 * <P>Description：</p>
 * <p>Copyright: Copyright (c) 2011 augurit</p>
 * <p>Company: 广州奥格智能科技</p>
 * History：
 * @author:zhangjun
 * @date Oct 15, 2011
 * @version 1.0
 */
@Repository("rqjszdjbDao")
public class YwRqQyjyxkFinalRqjszdjbDao  extends BaseDao<YwRqQyjyxkFinalRqjszdjb,Long>{

    public Long saveEntity(YwRqQyjyxkFinalRqjszdjb finalentity) {
        Session session=this.getSession();
        Long id=(Long) session.save(finalentity);
        return id;
    }

    public YwRqQyjyxkFinalRqjszdjb getEntity(Long id) {
        YwRqQyjyxkFinalRqjszdjb entity=null;
        Session session=this.getSession();
        Criteria criteria=session.createCriteria(YwRqQyjyxkFinalRqjszdjb.class);
        criteria.add(Restrictions.eq("id", id));
        List<YwRqQyjyxkFinalRqjszdjb> list=criteria.list();
        if(list!=null &&list.size()>0){
            entity=list.get(0);
        }
        return entity;
    }

}

